<?php
/**
 * Created by PhpStorm.
 * User: bobo
 * Date: 18-4-4
 * Time: 上午11:21
 */

namespace WsdServer\Lib\Facade;


class Request
{
    /**
     * Handle dynamic, static calls to the object.
     *
     * @param  string  $method
     * @param  array   $args
     * @return mixed
     *
     * @throws \RuntimeException
     */
    public static function __callStatic($method, $args)
    {
        //$instance = static::getFacadeRoot();
        $instance = get_instance()->getContext();

        if (! $instance) {
            throw new RuntimeException('A facade root has not been set.');
        }

        return $instance->$method(...$args);
    }

    public static function getClientIp()
    {
        return $_REQUEST['client_ip'];
    }

    public static function header()
    {
        return $_REQUEST['user_agent'];
    }

}